package com.client.service.impl;

import com.client.pojo.EntryLikes;
import com.client.dao.EntryLikesDao;
import com.client.service.EntryLikesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 词条点赞记录表 服务实现类
 * </p>
 *
 * @author ckick
 * @since 2025-09-20 08:28:54
 */
@Service
public class EntryLikesServiceImpl extends ServiceImpl<EntryLikesDao, EntryLikes> implements EntryLikesService {
    @Autowired
    private EntryLikesDao entryLikesDao;
    @Override
    public List<EntryLikes> getByIds(Integer userId) {
        return entryLikesDao.getByIds(userId);
    }
    @Override
    public boolean searchIfLiked(Integer userId, Integer entryId) {
        return entryLikesDao.searchIfLiked(userId,entryId);
    }
    @Override
    public void addLikes(Integer userId, Integer entryId, Integer authorId) {
        entryLikesDao.addLikes(userId,entryId,authorId);
    }
    @Override
    public void cancelLikes(Integer userId, Integer entryId) {
        entryLikesDao.cancelLikes(userId,entryId);
    }


}
